{$CLEO .cs}

0000: NOP 
wait 0 
14@ = Audiostream.Load3D("CLEO\minigun.mp3")
wait 50 

:start0
wait 0 
if and
   Actor.DrivingVehicleType($PLAYER_ACTOR, #JB700)
00E1:   player 0 pressed_key 3 // Special Control Up/Down. 
else_jump @start0 
0@ = Actor.CurrentCar($PLAYER_ACTOR)

wait 50
08A6: set_car 0@ componentA 4 rotation_to 0.2
08A6: set_car 0@ componentA 5 rotation_to 0.2
wait 50 
08A6: set_car 0@ componentA 4 rotation_to 0.4
08A6: set_car 0@ componentA 5 rotation_to 0.4
wait 50 
08A6: set_car 0@ componentA 4 rotation_to 0.6
08A6: set_car 0@ componentA 5 rotation_to 0.6
wait 50 
08A6: set_car 0@ componentA 4 rotation_to 0.8
08A6: set_car 0@ componentA 5 rotation_to 0.8
wait 50 
08A6: set_car 0@ componentA 4 rotation_to 1.0
08A6: set_car 0@ componentA 5 rotation_to 1.0

:start1
wait 0 
if
   Actor.DrivingVehicleType($PLAYER_ACTOR, #JB700)
else_jump @start0

wait 0 
if
00E1:   player 0 pressed_key 4 // Secondary Fire. 
else_jump @start2
jump @fire

:start2
if
00E1:   player 0 pressed_key 3 // Special Control Up/Down. 
else_jump @start1
jump @close

:fire
0208: 7@ = random_float_in_ranges -1.0 1.0 
0208: 8@ = random_float_in_ranges -1.0 1.0 

0407: store_coords_to 1@ 2@ 3@ from_car 0@ with_offset 7@ 100.0 8@

0407: store_coords_to 4@ 5@ 6@ from_car 0@ with_offset 0.75 1.65 0.41 
0407: store_coords_to 10@ 11@ 12@ from_car 0@ with_offset -0.75 1.65 0.41
 
06BC: create_M4_shoot_from 4@ 5@ 6@ target 1@ 2@ 3@ energy 100 
06BC: create_M4_shoot_from 10@ 11@ 12@ target 1@ 2@ 3@ energy 100 
 
09F1: play_audio_at_actor $PLAYER_ACTOR event 1157 

066C: 9@ = attach_particle "GUNFLASH" to_car 0@ with_offset 0.75 1.65 0.41 rotation 0.0 90.0 0.0 type 1 
064C: make_particle 9@ visible 

066C: 13@ = attach_particle "GUNFLASH" to_car 0@ with_offset -0.75 1.65 0.41 rotation 0.0 90.0 0.0 type 1 
064C: make_particle 13@ visible

wait 100 
064F: remove_references_to_particle 9@
064F: remove_references_to_particle 13@
jump @start1

:close
08A6: set_car 0@ componentA 4 rotation_to 0.8
08A6: set_car 0@ componentA 5 rotation_to 0.8
wait 50 
08A6: set_car 0@ componentA 4 rotation_to 0.6
08A6: set_car 0@ componentA 5 rotation_to 0.6
wait 50 
08A6: set_car 0@ componentA 4 rotation_to 0.4
08A6: set_car 0@ componentA 5 rotation_to 0.4
wait 50 
08A6: set_car 0@ componentA 4 rotation_to 0.2
08A6: set_car 0@ componentA 5 rotation_to 0.2
wait 50 
08A6: set_car 0@ componentA 4 rotation_to 0.0
08A6: set_car 0@ componentA 5 rotation_to 0.0
wait 50

Car.RemoveReferences(0@)
jump @start0

0A93: end_custom_thread